<?php
$user = new Model('user');
$user->find(Session::get('mainuid'));
$ag = new Model('user_agency');
$ag->find($user->agid);
$weburl='https://'.$ag->domain.'/yglogin.html';
$indexs = include DOXCX_FRAME_PATH . '/controller/admin/index.php';
$indexList = $indexs[0];
if (!is_post()) {
  $list = (new Model('yg'))->list_all(['wid'=>$wid]);
} else {
  setApi();
  $id = $_POST['id'];
  if ('del'==pget('opt')) {//修改
    $yg = (new Model('yg'))->find(['wid' => $wid, 'id' => $id]);
    if (!$yg->id) sendError('找不到对象');
    $yg->delete();
    sendSuccess('删除成功');
  }
}
